<?php
/**
 * @ClassName: Test
 * @Description: 测试
 * @author: wyaohu
 * @Date: 2025-07-23 17:21
 * @Version: V1.0.0
 */

namespace app\meituan\controller;

use app\meituan\logic\BasicLogic;
use app\meituan\logic\StoreLogic;

class Test
{
    /**
     * 数据签名
     * @return \think\response\Json
     */
    public function makeSign()
    {
        $data = input();
        // 补充公共参数
        $data['appkey'] = '2f40fe34835d45f8889f1ef80ea99075';//appkey
        $data['timestamp'] = time();//时间戳
        $data['version'] = '1.0';//版本号
//        var_dump($data);
        $res = (new BasicLogic())->makeSign($data);
        return json(['code' => 0, 'message' => '成功', 'sign' => $res]);
    }

    /**
     * 查询门店信息
     * @return \think\response\Json
     */
    public function queryStore()
    {
        $store_id = input('store_id');
        $res = (new StoreLogic())->queryStore($store_id);
        return json(['code' => 0, 'message' => '成功', 'data' => $res]);
    }

    /**
     * 查询门店账户余额
     * @return \think\response\Json
     */
    public function queryStoreBalance()
    {
        $store_id = input('store_id');
        $res = (new StoreLogic())->queryStoreBalance($store_id);
        return json(['code' => 0, 'message' => '成功', 'data' => $res]);
    }

}